<?php

/**
 * Laravel-admin - admin builder based on Laravel.
 * @author z-song <https://github.com/z-song>
 *
 * Bootstraper for Admin.
 *
 * Here you can remove builtin form field:
 * Encore\Admin\Form::forget(['map', 'editor']);
 *
 * Or extend custom form field:
 * Encore\Admin\Form::extend('php', PHPEditor::class);
 *
 * Or require js and css assets:
 * Admin::css('/packages/prettydocs/css/styles.css');
 * Admin::js('/packages/prettydocs/js/main.js');
 *
 */

use Encore\Admin\Facades\Admin;
use SimpleSoftwareIO\QrCode\Facades\QrCode;

Encore\Admin\Form::forget(['map', 'editor']);

//\Encore\Admin\Grid\Column::extend('qr_code', function ($value) {
//    //生成二维码
//    $script = <<<'SCRIPT'
//$('.grid-column-qr_code').popover({
//    html: true,
//    container: 'body',
//    trigger: 'focus'
//});
//SCRIPT;
//
//    Admin::script($script);
//    $img = base64_encode(QrCode::format('png')->size(100)->generate("d"));
//    $img_tag = '<img src="data:image/png;base64,%s">';
//    $img = sprintf(
//        $img_tag,
//        $img
//    );
//    return <<<HTML
//<a href="javascript:void(0);" class="grid-column-qr_code text-muted" data-content='{$img}' data-toggle='popover' tabindex='0'>
//    <i class="fa fa-qrcode"></i>
//</a>&nbsp;二维码
//HTML;
//});
